<!DOCTYPE html>
<html>
<body>
<input id="input1">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="100" height="100" viewBox="0 0 100 100">
<a xlink:href="" id="svg-a"><text>Link</text></a>
</svg>
<script src="../../resources/js-test.js"></script>
<script>
var input1 = document.getElementById('input1');
var tab = '\t';
testRunner.overridePreference('WebKitTabToLinksPreferenceKey', true);
debug('tabToLinks=true');
shouldBe('input1.focus(); document.activeElement', 'input1');
shouldBe('eventSender.keyDown(tab); document.activeElement', 'document.getElementById("svg-a")');
document.activeElement.blur();

debug('tabToLinks=false');
testRunner.overridePreference('WebKitTabToLinksPreferenceKey', false);
shouldBe('input1.focus(); document.activeElement', 'input1');
shouldNotBe('eventSender.keyDown(tab); document.activeElement', 'document.getElementById("svg-a")');
</script>
</body>
